<!-- 用户列表 -->
<style>
	th {
		text-align: center;
	}
	
	.table>tbody>tr>td {
		line-height: 30px;
		text-align: center;
		height: 30px;
		margin: 0px;
	}
</style>
<div id="data_page" class="in_page">

	<div class="panel panel-default">
		<div class="panel-body">
			<form class="form-inline" method="get" name="keyword" id="keyword" action="{:U('Dealer/index')}">
				<div class="form-group">
					<select class="form-control" name="type">
						<option value="name">经销商</option>
						<option value="phone">手机号</option>
					</select>
					<input type="text" class="form-control" name="key">
				</div>
				<button type="submit" class="btn btn-sm btn-default">搜索</button>
				<!--<button type="submit" class="btn btn-sm btn-success" style="margin-left:20px" id="exportBtn">导出Excel</button>-->
				<div class="btn-group" role="group" aria-label="..." style="float:right;margin-right:10px">
					<a href="{:U('Dealer/add')}"><button type="button" class="btn btn-primary">添加经销商</button></a>
				</div>
			</form>
		</div>

	</div>
</div>
<table class="table table-striped table-bordered table-condensed  ">
	<thead>
		<tr>
			<th>key</th>
			<th>经销商</th>
			<th>电话</th>
			<th>查看旗下棋牌室</th>
			<th>操作</th>
		</tr>
	</thead>
	<tbody>
		<volist name="list" id="li">
			<tr>
				<td>{$li.key}</td>
				<td>{$li.name}</td>
				<td>{$li.phone}</td>
				<td>
					<a href="{:U('Dealer/show')}?id={$li.id}">
						<button type="button" class="btn btn-sm btn-primary">查看({$li.num})</button>
					</a>
				</td>
				<td>
					<a href="{:U('Dealer/update')}?id={$li.id}">
						<button type="button" class="btn btn-sm btn-success">修改</button>
					</a>
					<if condition="$li.num  gt 1">
						<a onclick="alert('旗下有棋牌室不允许删除')">
					<else/>
						<a href="{:U('Dealer/del')}?id={$li.id}">	
					</if>
						
						<button type="button" class="btn btn-sm btn-danger " s_id='{$li.id}'>删除</button>
					</a>
				</td>
			</tr>
		</volist>
	</tbody>
</table>
</div>
<div>{$page}</div>